﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy;

namespace ECommerce.Model.Order
{
    public partial class ECOrderProductInfo : EntityBase
    {
        private const string TABLE_NAME = "ECOrderProduct";
        private const string INSERT_SQL = "insert into ECOrderProduct ( [ID], [OrderID], [ProductID], [ProductName], [UnitPrice], [BuyNumber], [TotalPrice], [Size]) values ( @ID, @OrderID, @ProductID, @ProductName, @UnitPrice, @BuyNumber, @TotalPrice, @Size)";
        private const string UPDATE_SQL = "update ECOrderProduct set  [ID] = @ID, [OrderID] = @OrderID, [ProductID] = @ProductID, [ProductName] = @ProductName, [UnitPrice] = @UnitPrice, [BuyNumber] = @BuyNumber, [TotalPrice] = @TotalPrice, [Size] = @Size where ID = @ID";
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 订单编号
        /// </summary>
        public Int64 OrderID
        {
            get;
            set;
        }
        /// <summary>
        /// 产品号
        /// </summary>
        public Int32 ProductID
        {
            get;
            set;
        }
        /// <summary>
        /// 产品名称
        /// </summary>
        public String ProductName
        {
            get;
            set;
        }
        /// <summary>
        /// 单价
        /// </summary>
        public Double UnitPrice
        {
            get;
            set;
        }
        /// <summary>
        /// 数量
        /// </summary>
        public Int32 BuyNumber
        {
            get;
            set;
        }
        /// <summary>
        /// 总价
        /// </summary>
        public Double TotalPrice
        {
            get;
            set;
        }
        /// <summary>
        /// 尺寸
        /// </summary>
        public String Size
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "orderid":
                    this.OrderID = (Int64)value;
                    break;
                case "productid":
                    this.ProductID = (Int32)value;
                    break;
                case "productname":
                    this.ProductName = (String)value;
                    break;
                case "unitprice":
                    this.UnitPrice = (Double)value;
                    break;
                case "buynumber":
                    this.BuyNumber = (Int32)value;
                    break;
                case "totalprice":
                    this.TotalPrice = (Double)value;
                    break;
                case "size":
                    this.Size = (String)value;
                    break;
            }
        }
    }

}
